package com.twu.biblioteca;

public class User {
    private int username;
    private int password;
    private String name;
    private String email;
    private String phone;
    private boolean logged;

    private static int startUsername;

    public User(int password, String name, String email, String phone){
        this.username = setUsername();
        this.password = password;
        this.name = name;
        this.email = email;
        this.phone = phone;
        this.logged = false;
    }

    public User(){
        this.logged = false;
    }

    static {
        startUsername = 1111110;
    }

    public int setUsername(){
        startUsername += 1;
        return startUsername;
    }

    public void setPassword(int password) {
        this.password = password;
    }

    public int getUsername() {
        return username;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public boolean isLogged(){
        return logged;
    }

    public String getName() {
        return name;
    }

    public void logout() {
        this.logged = false;
    }
}
